﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CadastroTarefas.aspx.cs" Inherits="WebApp_Scrum.Protegido.CadastroTarefas" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="lblProjeto" runat="server" Text="Projeto"></asp:Label>
        <asp:DropDownList ID="dpProjetos" runat="server" AutoPostBack="True" 
            DataSourceID="odsProjetos" DataTextField="NomeProjeto" 
            DataValueField="CodigoProjeto">
        </asp:DropDownList>
        <asp:ObjectDataSource ID="odsProjetos" runat="server" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="Listar" 
            TypeName="BLL.ProjetosBLL"></asp:ObjectDataSource>
        <asp:Label ID="lblIteracao" runat="server" Text="Iteração"></asp:Label>
        <asp:DropDownList ID="dpIteracoes" runat="server" DataSourceID="odsIteracoes" 
            DataTextField="NomeIteracao" DataValueField="CodigoIteracao">
        </asp:DropDownList>
        <asp:ObjectDataSource ID="odsIteracoes" runat="server" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="Listar" 
            TypeName="BLL.IteracoesBLL">
            <SelectParameters>
                <asp:ControlParameter ControlID="dpProjetos" Name="CodigoProjeto" 
                    PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:Button ID="btnListarTarefaas" runat="server" Text="Listar tarefas" 
            onclick="btnListarTarefaas_Click" />
        <br />
        <asp:GridView ID="gvTarefas" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" DataKeyNames="CodigoTarefa" DataSourceID="odsTarefas" 
            ForeColor="#333333" GridLines="None">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:CommandField ShowSelectButton="True" />
                <asp:BoundField DataField="CodigoTarefa" HeaderText="CodigoTarefa" 
                    SortExpression="CodigoTarefa" />
                <asp:BoundField DataField="CodigoProjeto" HeaderText="CodigoProjeto" 
                    SortExpression="CodigoProjeto" />
                <asp:BoundField DataField="CodigoIteracao" HeaderText="CodigoIteracao" 
                    SortExpression="CodigoIteracao" />
                <asp:BoundField DataField="NomeTarefa" HeaderText="NomeTarefa" 
                    SortExpression="NomeTarefa" />
                <asp:BoundField DataField="TipoTarefa" HeaderText="TipoTarefa" 
                    SortExpression="TipoTarefa" />
                <asp:BoundField DataField="HorasPrevistas" HeaderText="HorasPrevistas" 
                    SortExpression="HorasPrevistas" />
                <asp:BoundField DataField="ValorNegocio" HeaderText="ValorNegocio" 
                    SortExpression="ValorNegocio" />
                <asp:BoundField DataField="SituacaoTarefa" HeaderText="SituacaoTarefa" 
                    SortExpression="SituacaoTarefa" />
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
        <asp:ObjectDataSource ID="odsTarefas" runat="server" 
            DataObjectTypeName="Models.Tarefas" InsertMethod="Incluir" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="Listar" 
            TypeName="BLL.TarefasBLL" UpdateMethod="Alterar">
            <SelectParameters>
                <asp:ControlParameter ControlID="dpIteracoes" Name="CodigoIteracao" 
                    PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <br />
        <asp:Button ID="btnNovaTarefa" runat="server" Text="Nova tarefa" 
            onclick="btnNovaTarefa_Click" />
        <br />
        <asp:FormView ID="frvTarefa" runat="server" CellPadding="4" 
            DataSourceID="odsTarefaDetails" ForeColor="#333333" 
            onitemdeleted="frvTarefa_ItemDeleted" oniteminserted="frvTarefa_ItemInserted" 
            onitemupdated="frvTarefa_ItemUpdated">
            <EditItemTemplate>
                <asp:TextBox ID="CodigoTarefaTextBox" runat="server"  visible="false"
                    Text='<%# Bind("CodigoTarefa") %>' />
                
                CodigoProjeto:
                <asp:TextBox ID="CodigoProjetoTextBox" runat="server" 
                    Text='<%# Bind("CodigoProjeto") %>' />
                <br />
                CodigoIteracao:
                <asp:TextBox ID="CodigoIteracaoTextBox" runat="server" 
                    Text='<%# Bind("CodigoIteracao") %>' />
                <br />
                NomeTarefa:
                <asp:TextBox ID="NomeTarefaTextBox" runat="server" 
                    Text='<%# Bind("NomeTarefa") %>' />
                <br />
                TipoTarefa:
                <asp:TextBox ID="TipoTarefaTextBox" runat="server" 
                    Text='<%# Bind("TipoTarefa") %>' />
                <br />
                HorasPrevistas:
                <asp:TextBox ID="HorasPrevistasTextBox" runat="server" 
                    Text='<%# Bind("HorasPrevistas") %>' />
                <br />
                ValorNegocio:
                <asp:TextBox ID="ValorNegocioTextBox" runat="server" 
                    Text='<%# Bind("ValorNegocio") %>' />
                <br />
                SituacaoTarefa:
                <asp:TextBox ID="SituacaoTarefaTextBox" runat="server" 
                    Text='<%# Bind("SituacaoTarefa") %>' />
                <br />
                <asp:Button ID="UpdateButton" runat="server" CausesValidation="True" 
                    CommandName="Update" Text="Salvar" />
                &nbsp;<asp:Button ID="UpdateCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancelar" />
            </EditItemTemplate>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <InsertItemTemplate>
                
                CodigoProjeto:
                <asp:TextBox ID="CodigoProjetoTextBox" runat="server" 
                    Text='<%# Bind("CodigoProjeto") %>' />
                <br />
                CodigoIteracao:
                <asp:TextBox ID="CodigoIteracaoTextBox" runat="server" 
                    Text='<%# Bind("CodigoIteracao") %>' />
                <br />
                NomeTarefa:
                <asp:TextBox ID="NomeTarefaTextBox" runat="server" 
                    Text='<%# Bind("NomeTarefa") %>' />
                <br />
                TipoTarefa:
                <asp:TextBox ID="TipoTarefaTextBox" runat="server" 
                    Text='<%# Bind("TipoTarefa") %>' />
                <br />
                HorasPrevistas:
                <asp:TextBox ID="HorasPrevistasTextBox" runat="server" 
                    Text='<%# Bind("HorasPrevistas") %>' />
                <br />
                ValorNegocio:
                <asp:TextBox ID="ValorNegocioTextBox" runat="server" 
                    Text='<%# Bind("ValorNegocio") %>' />
                <br />
                SituacaoTarefa:
                <asp:TextBox ID="SituacaoTarefaTextBox" runat="server" 
                    Text='<%# Bind("SituacaoTarefa") %>' />
                <br />
                <asp:Button ID="InsertButton" runat="server" CausesValidation="True" 
                    CommandName="Insert" Text="Inserir" />
                &nbsp;<asp:Button ID="InsertCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancelar" />
            </InsertItemTemplate>
            <ItemTemplate>
                CodigoProjeto:
                <asp:Label ID="CodigoProjetoLabel" runat="server" 
                    Text='<%# Bind("CodigoProjeto") %>' />
                <br />
                CodigoIteracao:
                <asp:Label ID="CodigoIteracaoLabel" runat="server" 
                    Text='<%# Bind("CodigoIteracao") %>' />
                <br />
                NomeTarefa:
                <asp:Label ID="NomeTarefaLabel" runat="server" 
                    Text='<%# Bind("NomeTarefa") %>' />
                <br />
                TipoTarefa:
                <asp:Label ID="TipoTarefaLabel" runat="server" 
                    Text='<%# Bind("TipoTarefa") %>' />
                <br />
                HorasPrevistas:
                <asp:Label ID="HorasPrevistasLabel" runat="server" 
                    Text='<%# Bind("HorasPrevistas") %>' />
                <br />
                ValorNegocio:
                <asp:Label ID="ValorNegocioLabel" runat="server" 
                    Text='<%# Bind("ValorNegocio") %>' />
                <br />
                SituacaoTarefa:
                <asp:Label ID="SituacaoTarefaLabel" runat="server" 
                    Text='<%# Bind("SituacaoTarefa") %>' />
                <br />
                <asp:Button ID="EditButton" runat="server" CausesValidation="False" 
                    CommandName="Edit" Text="Editar" />
                &nbsp;<asp:Button ID="DeleteButton" runat="server" CausesValidation="False" 
                    CommandName="Delete" Text="Excluir" />
            </ItemTemplate>
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
        </asp:FormView>
        <asp:ObjectDataSource ID="odsTarefaDetails" runat="server" 
            DataObjectTypeName="Models.Tarefas" DeleteMethod="Excluir" 
            InsertMethod="Incluir" OldValuesParameterFormatString="original_{0}" 
            SelectMethod="Ler" TypeName="BLL.TarefasBLL" UpdateMethod="Alterar">
            <DeleteParameters>
                <asp:Parameter Name="codigoTarefa" Type="Int32" />
            </DeleteParameters>
            <SelectParameters>
                <asp:ControlParameter ControlID="gvTarefas" Name="codigoTarefa" 
                    PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </div>
    </form>
</body>
</html>
